#include <iostream>
#include <vector>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n, k;
	cin >> n >> k;

	for (int i = 1; i < 2 * n; ++i)
	{
		cout << ((i + 1) / 2) << " " << (((i + 1) / 2) + (i % 2 ? 0 : 1)) << "\n";
	}
	cout << n << " " << 1 << "\n";

	int left = k - 2 * n;
	int x = 1, y = 1;

	while (left > 0)
	{
		auto expand = [&]()
		{
			if (y == n)
			{
				++x;
				y = 1;
			}
			else
			{
				++y;
			}
		};

		while (x == y || (x % n + 1) == y)
		{
			expand();
		}

		--left;
		cout << x << " " << y << "\n";
		expand();
	}

	return 0;
}
